<template>
  <el-container>
    <el-header height="60px">
      <div>
        <span>轻量级培养方案管理系统（课程负责人{{this.$session.get("bull")}}）</span>
      </div>
      <div>
        <el-button type="danger" @click="logout" round icon="el-icon-refresh-right" plain>退出登录</el-button>
      </div>
    </el-header>
    <el-container>
      <el-aside width="250px">
        <el-menu
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          unique-opened
          router
          :collapse-transition="true">

          <el-menu-item index="/manageCourse"><i class="el-icon-user"></i>课程信息管理</el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
        <el-dialog title="消息提示" :visible.sync="addDialogVisible" width="40%" @close="addDialogVisible = false">
          欢迎课程负责人<span style="font-size: large;font-weight: bold;color: #3a8ee6">{{this.$session.get("bull")}}</span>使用轻量级培养方案管理系统<br>
          点击👈左边的导航栏，进行相应操作<br>
          如在使用时遇到障碍，请将相关问题发送至邮箱1812190518@pop.zjgsu.edu.cn<br>
          祝您使用愉快！
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="addDialogVisible = false">开始使用</el-button>
          </div>
        </el-dialog>
      </el-main>
    </el-container>
  </el-container>

</template>


<script>
  export default {
    data(){
      return{
        addDialogVisible:true,
      }
    },
    name: 'home',
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      logout(){
        window.sessionStorage.clear();
        this.$router.push({ path: "/login"});
      }
    }
  }
</script>


<style scoped>
  .el-header{
    background: lightslategray;
    color: white;
    font-size: 25px;
    align-items: center;
    justify-content: space-between;
    display: flex;
  }
  .el-aside{
    background-color: lightslategray;
    height: 908px;
  }
  .el-main{
    background-color: whitesmoke;
  }
  .el-menu{
    border-right: 0;
  }
</style>
